-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mediation #219
base: master
Are you sure you want to change the base?
Mediation #219
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall lgtm - but I think mediation should be a suggests and not an includes, because it is only used for one design at the moment and not more generally useful.
importFrom(DeclareDesign,redesign) | ||
importFrom(DeclareDesign,set_diagnosands) | ||
importFrom(DeclareDesign,tidy_estimator) | ||
importFrom(broom,tidy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pull in tidy from generics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank for reviewing!
DESCRIPTION
Outdated
@@ -27,7 +27,9 @@ Depends: | |||
estimatr (>= 0.14.0) | |||
Imports: | |||
generics, | |||
rlang | |||
rlang, | |||
mediation, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mediation should probably be a suggets and not an imports.
mediator_regression + stage2_1 + stage2_2 + stage2_3 | ||
) | ||
|
||
if(mediation_package){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stopifnot(requireNamespace("mediation"))
R/mediation_analysis_designer.R
Outdated
# QBA: Quasi-Bayesian Approximation | ||
e1 <- lm(M ~ Z, data = data) | ||
e2 <- lm(Y ~ M + Z + M:Z, data = data) | ||
m <- mediate(e1, e2, sims = 100, treat = "Z", mediator = "M") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mediation::mediate
and remove import
We're getting errror
|
PR has been merged, but it's not in the latest cran version, so not sure how generics handles that. When I include importFrom broom,tidy it seems to be working fine, but let me revise again. Sorry, this has been sitting here for so long! |
Description
mediation_analysis_designer with Imai's package feature. Finally!
it needs GitHub's version of broom.
Checklist: